package test00.lx04.t01;

import java.util.Arrays;
import java.util.Comparator;

/**
 * @author ZQX
 * @date 2025-04-07
 */
public class MainTest {
    public static void main(String[] args) {
        Student[] arrStudents = {
                new Student("张三",18) ,
                new Student("李四",8) ,
                new Student("王五",38) ,
                new Student("赵六",28) ,
                new Student("田七",7) ,
        } ;

        // 实例化 Comparator 接口对象
        Comparator<Student> comparator = new ComparatorImpl() ;

        Arrays.sort(arrStudents, comparator) ;

        for (Student stu : arrStudents) {
            System.out.println(stu);
        }
    }
}
